StupidBeauty
Read times:2732Posted at: - no title specified

转载 How does “?android:attr/activatedBackgroundIndicator” work?

在ListView中,使用selector来切换列表中各个条目在不同状态下的背景时,应当使用 android:state_activated = "true" 来表示条目被选中时的状态。

http://stackoverflow.com/questions/15008150/how-does-androidattr-activatedbackgroundindicator-work

亮点:

If you open that file you will see the definition of the drawable which is important to understanding what is going on.

<selector xmlns:android = "http://schemas.android.com/apk/res/android" >

<item android:state_activated = "true" android:drawable = "@android:drawable/list_selector_background_selected" />

<item android:drawable = "@color/transparent" />

</selector>

Here we are defining a drawable with two states - default state is just transparent background and if the state is "state_activated" then our drawable is "list_selector_background_selected".

see  this link  for background information on on drawables and states.

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4